package com.yc.ssq.servlet;

import com.yc.ssq.Util.Utils;
import com.yc.ssq.dao.SsqDao;

import javax.rmi.CORBA.Util;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet(name = "YearServlet", value = "/year.s")
public class YearServlet extends HttpServlet {

    SsqDao dao = new SsqDao();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String year = request.getParameter("year");
        List<Map<String, Object>> data = dao.selectYear();
        Utils.writeJson(data, response);

    }


}
